package indi.jp.project.business.analysis.controller;

import indi.jp.project.business.analysis.service.UserAnalysisService;
import indi.jp.project.core.entity.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;
import java.util.Map;

/**
 * 人员统计
 *
 * @author jiangping
 * @date 2022/1/15
 */
@RestController
@RequestMapping("/analysis/user")
public class UserAnalysisController {

    @Autowired
    private UserAnalysisService userAnalysisService;

    @GetMapping("/queryUserAnalysis")
    public JsonResult queryUserAnalysis(){
        try {
            Map<String, Object> map = userAnalysisService.queryUserAnalysis();
            return JsonResult.success(map);
        } catch (SQLException e) {
            e.printStackTrace();
            return JsonResult.error();
        }
    }
}
